<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <title>用户登录</title>
  <link rel="stylesheet" type="text/css" href="/lib/layui/css/layui.css">
  <link rel="stylesheet" type="text/css" href="/css/global.css">
</head>
<body>

<div id="app">
  <!--头部导航栏-->
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <ul class="layui-nav">
        <li class="layui-nav-item"><a href="/pages/index.html"><img src="/img/gamehub.png"></a></li>
        <li class="layui-nav-item"><a></a></li>

        <li class="layui-btn layui-btn-radius layui-btn-warm">
          <a href="/pages/news.html">新闻</a>
        </li>
        <li class="layui-nav-item"><a></a></li>

        <li class="layui-btn layui-btn-radius layui-btn-warm">
          <a href="/pages/game.html">游戏</a>
        </li>
        <!--<li class="layui-nav-item"><a ></a></li>-->

        <!--<li class="layui-btn layui-btn-radius layui-btn-warm">-->
        <!--<a href="javascript:void(0);" class="login" >新闻</a>-->
        <!--</li>-->

      </ul>
      <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item">
          <input type="text" ref="game" lay-verify="title" autocomplete="off" placeholder="文明" class="layui-input">
        </li>

        <li class="layui-nav-item"><a @click="gotoGame()"><img src="/img/search.png" style="cursor:pointer"></a></li>
        <span v-if="userName==null">
                <li class="layui-nav-item">
                    <a href="/pages/userLogin.html" target="_blank" class="login">登录</a>
                </li>

                <li class="layui-nav-item">
                    <a href="/pages/userRegiste.html" target="_blank" class="enroll">注册</a>
                </li>
                </span>
        <span v-if="userName!=null">
                <li class="layui-nav-item">
                    <a>{{userName}}</a>
                </li>

                <li class="layui-nav-item">
                    <a @click="logout()" style="cursor:pointer">退出</a>
                </li>
                </span>
      </ul>
    </div>
  </div>
</div>

<br><br><br><br><br><br>

<div class="layui-container layui-anim layui-anim-fadein" id="appLogin">
  <!--  卡片-->
  <div class="layui-row">
    <div class="layui-col-md-offset3 layui-col-md6">
      <div class="layui-card">
        <div class="layui-card-header" style="text-align: center">欢迎登录</div>
        <div class="layui-card-body">
          <form class="layui-form">

            <!--            用户名-->
            <div class="layui-row">
              <div class="layui-col-md-offset1 layui-col-md7">
                <div class="layui-form-item">
                  <label class="layui-form-label">用户名</label>
                  <div class="layui-input-block">
                    <input type="text" name="username" required lay-verify="required" placeholder="请输入用户名"
                           autocomplete="off" v-model="user.username" class="layui-input">
                  </div>
                </div>
              </div>
            </div>

            <!--            密码-->
            <div class="layui-row">
              <div class="layui-col-md-offset1 layui-col-md8">
                <div class="layui-form-item">
                  <label class="layui-form-label">密码</label>
                  <div class="layui-input-inline">
                    <input type="password" name="password" v-model="user.password" required
                           lay-verify="required" placeholder="请输入密码"
                           autocomplete="off" class="layui-input">
                  </div>
                </div>
              </div>
            </div>

            <div class="layui-row">
              <div class="layui-col-md-offset3 layui-col-md2">
                <div class="layui-form-item">
                  <div class="layui-input-block">
                    <button class="layui-btn layui-btn-warm layui-btn-radius" type="submit" @click.prevent="submit"
                            lay-filter="formDemo">立即提交
                    </button>
                  </div>
                </div>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>

<script src="/lib/layui/layui.js"></script>
<script src="/lib/js/vue.js"></script>
<script src="/lib/js/axios.min.js"></script>
<script src="/js/index.js"></script>
<script src="/js/userLogin.js"></script>
</body>
</html>